package com.joker.socketservice;

import com.joker.pojo.Message;
import com.joker.pojo.User_Message;
import com.joker.utily.DButil;

import java.sql.SQLException;

//自定义的service层
//操作usermesage的server
public class WebsocketUserMessage {
    //表名
    public String Tablename="user_message";
    //添加新记录
    public void addUserMessage(User_Message usermessage) throws SQLException, ClassNotFoundException {

        //表内的键名
        Object[] tname=new Object[4];
        tname[0]="userid";
        tname[1]="becalluserid";
        tname[2]="data";
        tname[3]="date";

        //value值
        Object[] tvalue=new Object[4];
        tvalue[0]=usermessage.getUserid();
        tvalue[1]=usermessage.getBecalluserid();
        tvalue[2]=usermessage.getData();
        tvalue[3]=usermessage.getDate();

        DButil.add(Tablename,tname,tvalue);
    }

}
